package day15;

public class learn2  extends Thread{
    public static void main(String[] args) {
        System.out.println("**显示默认优先级**");
        //创建线程
        Thread thread=new Thread();
        System.out.println("主线程的名字:"+currentThread().getName()+"\t"+"优先级:"+currentThread().getPriority());
        System.out.println("子线程的名字"+thread.getName()+"\t"+"优先级"+thread.getPriority());
        System.out.println("***修改默认优先级后***");
        //修改优先级
        currentThread().setPriority(10);
        System.out.println("主线线程的名字:"+currentThread().getName()+"\t"+"优先级:"+currentThread().getPriority());
        thread.setPriority(1);
        System.out.println("子线程的名字:"+thread.getName()+"\t"+"优先级:"+thread.getPriority());
    }
}
